g_object_get (about, "use-header-bar", &use_header_bar, NULL);
if (!use_header_bar)
{
- GtkWidget *action_area;
-
- G_GNUC_BEGIN_IGNORE_DEPRECATIONS
- action_area = gtk_dialog_get_action_area (GTK_DIALOG (about));
- G_GNUC_END_IGNORE_DEPRECATIONS
-
priv->credits_button = gtk_toggle_button_new_with_mnemonic (_("C_redits"));
g_object_bind_property (priv->credits_page, "visible",
priv->credits_button, "visible", G_BINDING_SYNC_CREATE);
g_signal_connect (priv->credits_button, "toggled", G_CALLBACK (toggle_credits), about);
- gtk_container_add_with_properties (GTK_CONTAINER (action_area), priv->credits_button,
- "secondary", TRUE,
- NULL);
+
+ gtk_dialog_add_action_widget (GTK_DIALOG (about), priv->credits_button, GTK_RESPONSE_NONE);
+ gtk_container_child_set (GTK_CONTAINER (gtk_widget_get_parent (priv->credits_button)),
+ priv->credits_button,
+ "secondary", TRUE,
+ NULL);
priv->license_button = gtk_toggle_button_new_with_mnemonic (_("_License"));
g_object_bind_property (priv->license_page, "visible",
priv->license_button, "visible", G_BINDING_SYNC_CREATE);
g_signal_connect (priv->license_button, "toggled", G_CALLBACK (toggle_license), about);
- gtk_container_add_with_properties (GTK_CONTAINER (action_area), priv->license_button,
- "secondary", TRUE,
- NULL);
+ gtk_dialog_add_action_widget (GTK_DIALOG (about), priv->license_button, GTK_RESPONSE_NONE);
+ gtk_container_child_set (GTK_CONTAINER (gtk_widget_get_parent (priv->license_button)),
+ priv->license_button,
+ "secondary", TRUE,
+ NULL);
gtk_dialog_add_button (GTK_DIALOG (about), _("_Close"), GTK_RESPONSE_DELETE_EVENT);
}
* recommended; it allows you to set the dialog title, some convenient
* flags, and add simple buttons.
*
- * If “dialog” is a newly created dialog, the two primary areas of the
- * window can be accessed through gtk_dialog_get_content_area() and
- * gtk_dialog_get_action_area(), as can be seen from the example below.
- *
* A “modal” dialog (that is, one which freezes the rest of the application
* from user input), can be created by calling gtk_window_set_modal() on the
* dialog. Use the GTK_WINDOW() macro to cast the widget returned from
GTK_BUILDER_WARN_INVALID_CHILD_TYPE (buildable, type);
}
-/**
- * gtk_dialog_get_action_area:
- * @dialog: a #GtkDialog
- *
- * Returns the action area of @dialog.
- *
- * Returns: (transfer none): the action area
- *
- * Since: 2.14
- *
- * Deprecated:3.12: Direct access to the action area
- * is discouraged; use gtk_dialog_add_button(), etc.
- */
GtkWidget *
gtk_dialog_get_action_area (GtkDialog *dialog)
{
GDK_AVAILABLE_IN_ALL
gint gtk_dialog_run (GtkDialog *dialog);
-GDK_DEPRECATED_IN_3_10
-GtkWidget * gtk_dialog_get_action_area (GtkDialog *dialog);
GDK_AVAILABLE_IN_ALL
GtkWidget * gtk_dialog_get_content_area (GtkDialog *dialog);
GDK_AVAILABLE_IN_3_12
G_BEGIN_DECLS
void gtk_dialog_set_use_header_bar_from_setting (GtkDialog *dialog);
+GtkWidget *gtk_dialog_get_action_area (GtkDialog *dialog);
G_END_DECLS
#include <string.h>
#include "gtkmessagedialog.h"
+#include "gtkdialogprivate.h"
#include "gtkaccessible.h"
#include "gtkbuildable.h"
#include "gtklabel.h"
priv->message_type = GTK_MESSAGE_OTHER;
gtk_widget_init_template (GTK_WIDGET (dialog));
-G_GNUC_BEGIN_IGNORE_DEPRECATIONS
action_area = gtk_dialog_get_action_area (GTK_DIALOG (dialog));
-G_GNUC_END_IGNORE_DEPRECATIONS
gtk_button_box_set_layout (GTK_BUTTON_BOX (action_area), GTK_BUTTONBOX_EXPAND);
settings = gtk_widget_get_settings (GTK_WIDGET (dialog));
#include "gtkmain.h"
#include "gtksettings.h"
#include "gtkstylecontextprivate.h"
+#include "gtkdialogprivate.h"
#include <glib/gprintf.h>
priv->dialog = dialog;
content_area = gtk_dialog_get_content_area (dialog);
-G_GNUC_BEGIN_IGNORE_DEPRECATIONS
action_area = gtk_dialog_get_action_area (dialog);
-G_GNUC_END_IGNORE_DEPRECATIONS
/* Set the dialog up with HIG properties */
gtk_box_set_spacing (GTK_BOX (content_area), 2); /* 2 * 5 + 2 = 12 */
if (gtk_window_activate_default (GTK_WINDOW (dialog)))
return;
-G_GNUC_BEGIN_IGNORE_DEPRECATIONS
action_area = gtk_dialog_get_action_area (rc_dialog);
-G_GNUC_END_IGNORE_DEPRECATIONS
children = gtk_container_get_children (GTK_CONTAINER (action_area));
for (l = children; l; l = l->next)
test_children (void)
{
GtkBuilder * builder;
- GtkWidget *content_area, *dialog_action_area;
+ GtkWidget *content_area;
GList *children;
const gchar buffer1[] =
"<interface>"
g_assert (strcmp (gtk_buildable_get_name (GTK_BUILDABLE (content_area)), "dialog1-vbox") == 0);
action_area = gtk_builder_get_object (builder, "dialog1-action_area");
-G_GNUC_BEGIN_IGNORE_DEPRECATIONS
- dialog_action_area = gtk_dialog_get_action_area (GTK_DIALOG (dialog));
-G_GNUC_END_IGNORE_DEPRECATIONS
g_assert (action_area != NULL);
g_assert (GTK_IS_BUTTON_BOX (action_area));
g_assert (gtk_orientable_get_orientation (GTK_ORIENTABLE (action_area)) == GTK_ORIENTATION_HORIZONTAL);
g_assert (gtk_widget_get_parent (GTK_WIDGET (action_area)) != NULL);
- g_assert (dialog_action_area != NULL);
g_assert (gtk_buildable_get_name (GTK_BUILDABLE (action_area)) != NULL);
- g_assert (strcmp (gtk_buildable_get_name (GTK_BUILDABLE (dialog_action_area)), "dialog1-action_area") == 0);
gtk_widget_destroy (GTK_WIDGET (dialog));
g_object_unref (builder);
}
dialog = gtk_dialog_new();
g_assert (GTK_IS_DIALOG (dialog));
-G_GNUC_BEGIN_IGNORE_DEPRECATIONS
- g_assert (gtk_dialog_get_action_area (GTK_DIALOG (dialog)) != NULL);
-G_GNUC_END_IGNORE_DEPRECATIONS
g_assert (gtk_dialog_get_content_area (GTK_DIALOG (dialog)) != NULL);
gtk_widget_destroy (dialog);